//
//  VideoListViewController.m
//  YellowBridge
//
//  Created by 王右 on 2018/12/9.
//  Copyright © 2018年 王右. All rights reserved.
//

#import "VideoListViewController.h"
#import "VideoListTableViewCell.h"

@interface VideoListViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (strong, nonatomic) IBOutlet UIView *headerView;
@property (weak, nonatomic) IBOutlet UIView *containerView;
@property (weak, nonatomic) IBOutlet UILabel *projectNameLabel;
@property (weak, nonatomic) IBOutlet UIButton *selectProjectButton;
@property (weak, nonatomic) IBOutlet UITableView *baseTableView;

@end

@implementation VideoListViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    _selectProjectButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
    
    self.title = @"实时监控";
    _containerView.layer.cornerRadius = 5;
    _containerView.layer.masksToBounds = YES;
    
    _baseTableView.tableHeaderView = _headerView;
}

- (NSInteger )tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 2;
}

- (CGFloat )tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 200;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    VideoListTableViewCell *cell = (VideoListTableViewCell *)[tableView cellWithCellNibName:@"VideoListTableViewCell"];
    cell.liveImageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"liveImage_%ld",(long)indexPath.row]];
    cell.nameLabel.text = indexPath.row==0?@"摄像头A - 施工区域":@"摄像头B - 生活区域";
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    [self.view makeToast:@"暂未获取到视频直播流!"];
}
- (IBAction)selectProjectAction:(id)sender {
    [self.view makeToast:@"该功能处于维护中,请稍后再试!"];
}

@end
